home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / gas_251.zip / bin_251 / bfd / libieee.h < prev    next >
Text File  |  1994-03-15  |  3KB  |  136 lines

  1. /* IEEE-695 object file formats:  definitions internal to BFD.
  2.    Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc.
  3.    Written by Cygnus Support.  Mostly Steve Chamberlain's fault.
  4.  
  5. This file is part of BFD, the Binary File Descriptor library.
  6.  
  7. This program is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 2 of the License, or
  10. (at your option) any later version.
  11.  
  12. This program is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. GNU General Public License for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with this program; if not, write to the Free Software
  19. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  20.  
  21. typedef struct {
  22.   unsigned int index:24;
  23.   char letter;
  24. } ieee_symbol_index_type;
  25.  
  26. typedef struct ct {
  27.   bfd *this;
  28.   struct ct *next;
  29. } bfd_chain_type;
  30.  
  31. typedef struct ieee_symbol 
  32. {
  33.   asymbol symbol;
  34.   struct ieee_symbol *next;
  35.  
  36.   unsigned int index;
  37. } ieee_symbol_type;
  38.  
  39.  
  40. typedef struct ieee_reloc {
  41.   arelent relent;
  42.   struct ieee_reloc *next;
  43.   ieee_symbol_index_type symbol;
  44.  
  45. } ieee_reloc_type;
  46.  
  47. #define ieee_symbol(x) ((ieee_symbol_type *)(x))
  48.  
  49. typedef struct ieee_per_section
  50. {
  51.   asection *section;
  52.   bfd_byte *data;
  53.   bfd_vma offset;
  54.   bfd_vma pc;
  55.   /* For output */
  56.   file_ptr current_pos;
  57.   unsigned int current_byte;
  58.   boolean initialized;
  59.   ieee_reloc_type **reloc_tail_ptr;
  60. } ieee_per_section_type;
  61.  
  62. #define ieee_per_section(x) ((ieee_per_section_type *)((x)->used_by_bfd))
  63. /* FIXME!  There should be no limit to the number of sections!  */
  64. #define NSECTIONS 20
  65.  
  66.   
  67. typedef struct {
  68.   unsigned  char *input_p;
  69.   unsigned char *first_byte;
  70.   bfd *abfd;
  71. } common_header_type ;
  72.  
  73. typedef struct ieee_data_struct
  74. {
  75.   common_header_type h;
  76.   boolean read_symbols;
  77.   boolean read_data;    
  78.   file_ptr output_cursor;
  79.   /* Map of section indexes to section ptrs */
  80.   asection * section_table[NSECTIONS];
  81.   ieee_address_descriptor_type ad;
  82.   ieee_module_begin_type mb;
  83.   ieee_w_variable_type w;
  84.   
  85.   unsigned int section_count;
  86.   
  87.   unsigned int map_idx;
  88.   /* List of GLOBAL EXPORT symbols */
  89.   ieee_symbol_type *external_symbols;
  90.   /* List of UNDEFINED symbols */
  91.   ieee_symbol_type *external_reference;
  92.   
  93.   /* When the symbols have been canonicalized, they are in a
  94.     * special order, we remember various bases here.. */
  95.   unsigned int external_symbol_max_index;
  96.   unsigned int external_symbol_min_index;
  97.   unsigned int external_symbol_count;
  98.   int external_symbol_base_offset;
  99.   
  100.   unsigned int external_reference_max_index;
  101.   unsigned int external_reference_min_index;
  102.   unsigned int external_reference_count;
  103.   int external_reference_base_offset;
  104.   
  105.  
  106.   boolean symbol_table_full;
  107.  
  108.   
  109. boolean done_debug;
  110.  
  111.  
  112. bfd_chain_type *chain_head;
  113. bfd_chain_type *chain_root;
  114.  
  115. } ieee_data_type;
  116.  
  117. typedef struct {
  118.   file_ptr file_offset;
  119.   bfd *abfd;
  120. } ieee_ar_obstack_type;
  121.  
  122. typedef struct ieee_ar_data_struct 
  123. {
  124.   common_header_type h;
  125.   ieee_ar_obstack_type *elements;
  126.   
  127.   unsigned  int element_index ;
  128.   unsigned int element_count;
  129.  
  130. } ieee_ar_data_type;
  131.  
  132. #define IEEE_DATA(abfd) ((abfd)->tdata.ieee_data)
  133. #define IEEE_AR_DATA(abfd) ((abfd)->tdata.ieee_ar_data)
  134.  
  135. #define ptr(abfd) (ieee_data(abfd)->input_p)
  136.